<?php

namespace app\admin\model\vppz;

use think\Model;
use think\Db;
use traits\model\SoftDelete;

class VipCard extends Model
{

    use SoftDelete;



    // 表名
    protected $name = 'vppz_vip_card';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';
      protected $append = [
        'qrcode_url'
    ];
  public function user()
    {
        return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
        public function getStatusList()
    {
        return ['0' => __('Status 0'), '1' => __('Status 1')];	//'0' => __('Status 0'),
    }
    	public function getQrcodeUrlAttr($value,$data)
    {
        return \addons\vppz\library\Vpower::dourl($data['qrcode']);
    }
}
